package _99练习;

import java.util.*;

// 3. 定义一个员工类 员工编号 姓名 部门
// 创建一个容器，将以下员工放入:
// 10001 乔布斯 销售部
// 10002 盖茨 工程部
// 10003 赵云 客服部
// 10004 貂蝉 公关部
// 移除10001编号的员工 ,如果编号相同。认为是同一个人。
public class Employee {
	String num;
	String name;
	String department;

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public Employee(String num, String name, String department) {

		this.num = num;
		this.name = name;
		this.department = department;
	}

	public Employee() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	public int hashCode() {
		return Objects.hash(num);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Employee other = (Employee) obj;
		return Objects.equals(num, other.num);
	}

	@Override
	public String toString() {
		return "Employee [num=" + num + ", name=" + name + ", department=" + department + "]";
	}

}
